package util.common;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

public class JsonUtil {

    private static Gson exposeGson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create();
    private static Gson gson = new GsonBuilder().create();

    public static String toJson(Object o){
        return exposeGson.toJson(o);
    }

    public static Object fromJson(String str, Class clazz){
        return gson.fromJson(str, clazz);
    }
}
